﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CarErp.Model;

namespace CarErp.Forms
{
	public partial class ApprovelForm : Form
	{
		public ApprovelForm() :
			this(null)
		{ }

		public ApprovelForm(User user)
		{
			User = user;
			InitializeComponent();			
		}

		private void button_Submit_Click(object sender, EventArgs e)
		{
			var model = carPurchaseApprovalView.GetModel();
			model.Approver = User;

			OnApproved?.Invoke(model);
		}

		public event Action<CarPurchaseApprovalPaper> OnApproved;

		private User User;
	}
}
